﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Default/Views/Shared/Store.Master" Inherits="System.Web.Mvc.ViewPage<Fashion.ViewModels.StoreIndexViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Advance Search
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="leftnav">
        <ul>
            <% foreach (var category in Model.Categories)
               { %>
            <li>
                <%: Html.ActionLink(category, "Browse", "Women", new { category = category }, null)%>
            </li>
            <% } %>
        </ul>
        <% if ((int)ViewData["totalProducts"] == 0)
       { %>
            <ul>
                <li><%: Html.ActionLink("Return Home", "Index", "Home")%></li>
                <li><%: Html.ActionLink("Women's Apprearance", "List", "Women")%></li>
                <li><%: Html.ActionLink("Men's Apprearance", "List", "Men")%></li>
            </ul>
        <% } %>
    </div>
      
    <p>Found: <strong><%= ViewData["totalProducts"] %></strong> Products</p>
    
    <% if ((int)ViewData["totalProducts"] == 0)
       { %>
        <p>Sorry! No Product Found.</p>
        <p align="center">Try <%: Html.ActionLink("Search Again", "Index", "Search")%>?</p>
    <% }
       else
       { %>    
    
        <div class="viewitems">
            <% foreach (var product in Model.Products)
               { %>
            <div class="viewitem">
                <img src="../../../../Content/<%: product.ImageList %>" alt="<%: product.ProductName %>" width="85" height="140" />
                <p>
                <%: product.ProductName %>
                     <span>$
                        <%: product.Price %> </span><%= Html.ActionLink("Details", "Product", product.control, new { pid = product.ProductID }, null)%>
                </p>
            </div>
        <% } %>
        </div>
        <br />
        <% if ((string)ViewData["pageLinks"] != "")
           { %>
           <%= ViewData["pageLinks"] %>
           <br /><br />
        <% } %>       
    <% } %>
</asp:Content>
